import React, { Component } from 'react'
import { Redirect, Route, Switch } from 'react-router-dom'

import LeftNav from '../../components/left-nav/index'
import Header from '../../components/header/index'
import storageUtils from "../../utils/storageUtils"

import Resume from '../resume'
import Search from '../search'

import './index.less'

import { Layout } from 'antd'
const { Content } = Layout

export default class admin extends Component {
  
  render() {
    const user = storageUtils.getUser()?.username
    if(!user) {
      return <Redirect to="/login" />
    }
    return (
      <div className="container">
        <Layout style={{ minHeight: '100vh' }}>
          <LeftNav />
          <Layout>
            <Header>Header</Header>
            <Content className="content">
              <Switch>
                <Route path="/home" component={Resume} />
                <Route path="/screen" component={Search} />
                <Redirect to="/home" />
              </Switch>
            </Content>
          </Layout>
        </Layout>
      </div>
    )
  }
}
